package com.xhs.service.impl;

import lombok.extern.slf4j.Slf4j;

/**
 * @desc: 实现Runnable接口创建线程
 * @projectName: tools-parent
 * @author: xhs
 * @date: 2022/12/5 21:29
 * @version: JDK 1.8
 */
@Slf4j
public class Thread2ServiceImpl implements Runnable {
    @Override
    public void run() {
        log.info(">>>>>>>>>>>>>>实现Runnable接口创建线程:{},我是子线程<<<<<<<<<<<<<<<<<<<<", Thread.currentThread().getName());
    }

    public static void main(String[] args) {
        log.info(">>>>>>>>>>>>>>实现Runnable接口创建线程:{},我是主线程<<<<<<<<<<<<<<<<<<<<", Thread.currentThread().getName());
        Thread thread = new Thread(new Thread2ServiceImpl());
        thread.start();
        log.info(">>>>>>>>>>>>>>实现Runnable接口创建线程:{},我是主线程<<<<<<<<<<<<<<<<<<<<", Thread.currentThread().getName());
    }
}
